﻿namespace NTLib.Pipe.Exceptions
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Exception raised when the pipe source didn't receive the good target, it could mean an error in the target provider or the pipe provider.
    /// </summary>
    public class InvalidTargetTypeException : PipeException
    {
        #region Fields

        private readonly Type _typeGet;
        private readonly Type _typeWanted;

        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the <see cref="InvalidTargetTypeException"/> class.
        /// </summary>
        /// <param name="get">The type get.</param>
        /// <param name="Wanted">The type wanted.</param>
        /// <param name="message">The message.</param>
        /// <param name="inner">The inner.</param>
        public InvalidTargetTypeException(Type get, Type wanted, string message = null, Exception inner = null)
            : base(message, inner)
        {
            this._typeGet = get;
            this._typeWanted = wanted;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets the get.
        /// </summary>
        public Type Get
        {
            get { return this._typeGet; }
        }

        /// <summary>
        /// Gets the wanted.
        /// </summary>
        public Type Wanted
        {
            get { return this._typeWanted; }
        }

        #endregion
    }
}
